function getData(){
    let data = location.search;
    data = data.substring(1);
    let sa = data.split("&");
    let json = {}
    for (let i = 0;i < sa.length;i++){
        let d = sa[i].split("=");
        json[d[0]] = d[1];
    }
    return json;
}
//登录验证
// 登录验证
function LoginVerify(){
    console.log("进行登陆验证");
    $.ajax({
        url:"loginVerify",
        type:"get",
        dataType:"json",
        success:function (response){
            if(response.state==300){
                let a = alert(response.message);
                window.location.href="login.html";
            }
        }
    })
}

function parseRequestParam(){
    //获取请求中带入的参数列表
    let url = location.search;
    //截取?后面的参数内容
    url = url.substring(1);
    //console.log(url);

    //创建JSON对象,封装请求传入的参数
    let paramJson = {};

    let paramArray = url.split("&");
    for(let i = 0; i < paramArray.length; i++){
        //console.log(paramArray[i]);
        //键值对数组，索引0为键，索引1为值
        let keyValueArray = paramArray[i].split("=");
        paramJson[keyValueArray[0]] = keyValueArray[1];
    }
    //console.log(paramJson);

    return paramJson;
}

